"use strict";

/**
 * 班级相关接口调用
 */
import Ajax from "../libs/ajax";

//导入班级
// export function importClassgrade(data) {
//     return Ajax.ajax({
//         url: '/api/classgrade/import_classgrade',
//         method: 'post',
//         data: data
//     }).then(res => res.data)
// }

// 
export function getClassgrade(query) {
    if (query.page_num === undefined || query.page_size === undefined) {
        return new Promise((resolve, reject) => {
            resolve({ code: 2011, msg: "班级查询参数缺失" });
        });
    }
    return Ajax.ajax({
        url: "/api/classgrade/query",
        method: "post",
        data: query
    }).then(res => res.data);
}

export function addClassgrade(data) {
    return Ajax.ajax({
        url: "/api/classgrade/add",
        data: data,
        method: "post"
    }).then(res => res.data);
}

export function updateClassgrade(data) {
    return Ajax.ajax({
        url: "/api/classgrade/update",
        data: data,
        method: "post"
    }).then(res => res.data);
}

export function deleteClassgrade(data) {
    return Ajax.ajax({
        url: "/api/classgrade/delete",
        data: data,
        method: "post"
    }).then(res => res.data);
}